<template>
	<view class="contain">
		<view class="top">
			<view class="detail bcf">
				<view class="tit b f34">钱包余额</view>
				<view style="margin-top: 50rpx;" class="num f64 b mt30"><text class="f44"
						style="font-weight: 500;">¥</text>1909</view>
			</view>
			<view class="right fc">
				<view class="txt  mr20" style="color: #FF7157;">去充值</view>
				<u-icon name="arrow-right" color="#FF7157" size="40"></u-icon>
			</view>
		</view>
		<view class="tabs fbc mt30">
			<view class="tabs-item" :class="number==index?'tabs1':''" v-for="(item,index) in tabslist"
				@click="tochange(index)">{{item.name}}</view>
		</view>
		<view class="box bg_w ml30 mr30 mt30 rd20">
			<view class="box-top fbc">
				<view class="time fc" @click="show=true">
					<view class="txt f32 b">{{selectTime}}</view>
					<u-icon name="arrow-down-fill" size="20"></u-icon>
				</view>
				<view class="money f32 b">+200</view>
			</view>
			<view class="box-bottom">
				<scroll-view :scroll-y="true" class="scroll">
					<view class="list bc3 fbc" v-for="item in 7">
						<view class="list-details">
							<view class="title">充值</view>
							<view class="times f22 mt20">2020-03-12 18:03</view>
						</view>
						<view class="gets">+20</view>
					</view>
				</scroll-view>
			</view>
		</view>
		<u-picker v-model="show" @confirm="confirm" mode="time" :params="params"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabslist: [{
					name: '入账'
				}, {
					name: '出账'
				}],
				number: '0',
				selectTime: '',
				show: false,
				params: {
					year: true,
					month: true,
					day: false,
					hour: false,
					minute: false,
					second: false
				},
			}
		},
		onLoad() {
			let time = new Date()
			let year = time.getFullYear()
			let month = time.getMonth() + 1
			if (month < 10) {
				month = '0' + month
			}
			this.selectTime = year + '年' + month + '月'
		},
		methods: {
			tochange(index) {
				this.number = index
			},
			confirm(e) {
				this.selectTime = e.year + '年' + e.month + '月'
			}
		}
	}
</script>

<style>
	.top {
		background: url('https://xiyanluo.oss-cn-beijing.aliyuncs.com/0lizhi/money-bg%402x.png') center center /100% 100% no-repeat;
		height: 432rpx;
	}

	.top {
		position: relative;
	}

	.tit {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
	}

	.f44 {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF
	}

	.num {
		font-size: 64rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}

	.detail {
		position: absolute;
		top: 200rpx;
		left: 70rpx;
	}

	.right {
		position: absolute;
		bottom: 154rpx;
		right: 60rpx;
	}

	.txt {
		font-size: 43rpx;
		font-family: PingFang SC;
		/* font-weight: bold; */
		color: #FF7157;
	}

	.tabs {
		/* padding: 50rpx 210rpx 30rpx 210rpx; */
		/* position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		margin: 0 auto; */
	}

	.tabs-item {
		width: 50%;
		text-align: center;
		font-size: 32rpx;
	}

	.tabs1 {
		color: #FF6B55;
		font-weight: bold;
		position: relative;
	}

	.tabs1::after {
		position: absolute;
		display: block;
		width: 60rpx;
		height: 4rpx;
		border-radius: 4rpx;
		content: '';
		background-color: #FF7157;
		left: 42%;
		bottom: -10rpx;
	}

	.box {
		padding: 40rpx 30rpx;
	}

	.scroll {
		height: 700rpx;
	}

	.list {
		border-bottom: 1rpx solid #ebebeb;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
	}
</style>